var app = getApp();
var letters=require('../../utils/cityInfo.js').letters;
Page({
    data: {
        loading: true,
        loadtxt: '正在加载',
 
    },

    onLoad:function(){
        this.type=arguments[0].type;
 
        var that=this;
 
        app.get('/BusTicketInfo.go',{
            method:'querySellStationInfo' 

        }).then(function(data){
            if(data.totalCount>0){
 
                that.setData({
 
                    startstation:data.rows
                    
                })
            }
           that.setData({
                loading: false  
            })
        }).catch(function(e){
            console.log(e)
        })

 
    },
 
 

  
    bindChangeCity: function(e) { //绑定返回的页面
      var city = e.currentTarget.dataset.city;
      var cityid= e.currentTarget.dataset.cityid;
      var selldate=e.currentTarget.dataset.sellday;
      var fn = app.globalData.cityFn;
      var type=this.type;
      if (typeof fn == 'function') {
        setTimeout(function(){
          fn(city,cityid,type,selldate);
          app.globalData.cityFn=null;
        },0)
        wx.navigateBack({
          delta: 1
        });
      }
    },
  
})

 